<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Cache-Control" content="no-store" />
<meta http-equiv="Expires" content="0" />

<title>代码生成器</title>

</head>
<body>
	<input name="database.id" type="hidden" th:value="${database?.id}"/>
	<div class="form-group" style="margin-top: 10px;margin-bottom: 10px;">
		<label class="col-sm-2 control-label">类型：</label>
		<div class="col-sm-10">
			<select name="database.type" class="form-control">
				<option th:each="databaseType : ${databaseTypes}" th:value="${databaseType.dbType}" th:selected="${databaseType.dbType == database?.type}" th:text="${databaseType.typeName}" th:_driver="${databaseType.driver}" th:_port="${databaseType.port}" th:_username="${databaseType.username}" th:_databaseWidgetType="${databaseType.databaseWidgetType}" th:_defaultDatabaseName="${databaseType.defaultDatabaseName}"></option>
			</select>
			<input name="database.driver" type="hidden" value="com.mysql.jdbc.Driver"/>
		</div>
	</div>
	<div class="form-group" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label">地址：</label>
		<div class="col-sm-10">
			<input name="database.url" class="form-control" th:value="${database?.url}" maxlength="255" placeholder="不能为空"/>
		</div>
	</div>
	<div class="form-group" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label">端口号：</label>
		<div class="col-sm-10">
			<input name="database.port" class="form-control" th:value="${database?.port}" maxlength="5" placeholder="不能为空且必须在1至65535之间"/>
		</div>
	</div>
	<div class="form-group" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label">用户名：</label>
		<div class="col-sm-10">
			<input name="database.username" class="form-control" th:value="${database?.username}" maxlength="25" placeholder="不能为空"/>
		</div>
	</div>
	<div class="form-group" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label">密码：</label>
		<div class="col-sm-10">
			<input name="database.password" type="password" class="form-control" th:value="${database?.password}" maxlength="255" placeholder="不能为空"/>
		</div>
	</div>
	<div class="form-group database" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label" th:text="${databaseType.databaseWidgetDesc}"></label>
		<div class="col-sm-10 widget">
			<select th:if="${databaseType.databaseWidgetType.toString() == 'SELECT'}" name="database.databaseName" class="form-control">
				<option th:each="databaseName : ${databaseNames}" th:value="${databaseName.database}" th:selected="${databaseName.database == database?.databaseName}" th:text="${databaseName.databaseName}" th:title="${databaseName.databaseDesc}"></option>
			</select>
			<input th:if="${databaseType.databaseWidgetType.toString() == 'INPUT'}" name="database.databaseName" type="text" class="form-control" th:value="${database?.databaseName}" maxlength="255" placeholder="不能为空"/>
		</div>
	</div>
	<div class="form-group" style="margin-bottom: 10px;">
		<label class="col-sm-2 control-label">连接字符串：</label>
		<div class="col-sm-10">
			<input name="database.connectionUrl" type="hidden" value="jdbc:mysql://localhost:10000/test?characterEncoding=UTF-8"/>
			<p class="form-control-static connectionUrl">jdbc:mysql://localhost:10000/test?characterEncoding=UTF-8</p>
		</div>
	</div>
		
</body>
<script type="text/javascript" th:src="@{/scripts/generator/database.js}"></script>
</html>
